import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;


public class BonusesForm extends JPanel{
	private static final long serialVersionUID = 1L;
	private JLabel ulabel, userID, splabel, curAddit, aplabel, relabel;
	private JTextField newAddit, reaSon;

	public BonusesForm() {
		//construct components
		ulabel = new JLabel ("UserID:");
		userID = new JLabel ("");
		splabel = new JLabel ("Current extra payments:");
		curAddit = new JLabel ("");
		aplabel = new JLabel ("Additional payments:");
		newAddit = new JTextField ();
		relabel = new JLabel ("Reason:");
		reaSon = new JTextField ();

		//adjust size and set layout
		setPreferredSize (new Dimension (434, 304));
		setLayout (null);

		//add components
		add (ulabel);
		add (userID);
		add (splabel);
		add (curAddit);
		add (aplabel);
		add (newAddit);
		add (relabel);
		add (reaSon);

		//set component bounds (only needed by Absolute Positioning)
		ulabel.setBounds (25, 65, 55, 25);
		userID.setBounds (70, 65, 100, 25);
		splabel.setBounds (25, 95, 145, 25);
		curAddit.setBounds (180, 95, 100, 25);
		aplabel.setBounds (25, 125, 130, 25);
		newAddit.setBounds (160, 125, 100, 25);
		relabel.setBounds (25, 160, 55, 25);
		reaSon.setBounds (85, 160, 100, 25);


		setSize(440,350);
		setOpaque(false);
		setLayout(null);


		ulabel.setForeground(Color.WHITE);
		userID.setForeground(Color.WHITE);
		splabel.setForeground(Color.WHITE);
		curAddit.setForeground(Color.WHITE);
		aplabel.setForeground(Color.WHITE);
		relabel.setForeground(Color.WHITE);
		reaSon.setForeground(Color.WHITE);

	}
	
	public void setCurAddit(String dbCur){
		curAddit.setText(dbCur);
	}
	
	public void setuID(int UID){
		userID.setText(String.valueOf(UID));
	}
	
	public String getNewAddit(){
		return newAddit.getText().trim();
	}
	
	public String getReason(){
		String son = reaSon.getText().trim();
		if(son.length() == 0)
			son = "invalid";
		return son;
	}
}

